<template>
  <div>
    <Header></Header>
    <div style="max-width: 1000px; margin:auto">
      <div style="font-size: 25px;margin-top: 45px;margin-bottom: 40px;">
        我的收藏
      </div>
      <div v-for="item in this.projects">

        <ProjectBrief :item="item"></ProjectBrief>
      </div>

      <div v-if="projects.length === 0" style="
        text-align: center;color: #777777;background-color: white;height: 100px;padding-top: 80px;">
        暂时没有项目，去
        <span @click="$router.push('/')" style="cursor: pointer;color: #9dc15b">
            首页
          </span>
        收藏项目吧
      </div>
    </div>
  </div>
</template>

<script>
import Header from "@/components/Header";
import ProjectBrief from "@/components/ProjectBrief";
export default {
  name: "Stars",
  components: {ProjectBrief, Header},
  data(){
    return{
      projects:[]
    }
  },
  mounted() {
    this.$axios('project/stars/',{
      params:{
        token:localStorage.getItem("token")
      }
    }).then(res=>{
      if(res.status === 200){
        this.projects = res.data
      }else{
        this.$notify.error({
          title: '错误',
          message: res.data
        });
        return
      }

    })
  }
}
</script>

<style scoped>

</style>